namespace EasyWeb.Test
{
    using System;
    using System.Data.Entity;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Linq;

    public partial class TestDbContext : DbContext
    {
        public TestDbContext()
            : base("name=EasyWeb")
        {
        }

        public virtual DbSet<ew_tbl_configurations> ew_tbl_configurations { get; set; }
        public virtual DbSet<ew_tbl_cultures> ew_tbl_cultures { get; set; }
        public virtual DbSet<ew_tbl_easyweb> ew_tbl_easyweb { get; set; }
        public virtual DbSet<ew_tbl_entities> ew_tbl_entities { get; set; }
        public virtual DbSet<ew_tbl_fields> ew_tbl_fields { get; set; }
        public virtual DbSet<ew_tbl_selection_items> ew_tbl_selection_items { get; set; }
        public virtual DbSet<ew_tbl_selections> ew_tbl_selections { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<ew_tbl_configurations>()
                .Property(e => e.ew_vc_name)
                .IsUnicode(false);

            modelBuilder.Entity<ew_tbl_configurations>()
                .Property(e => e.ew_vc_description)
                .IsUnicode(false);

            modelBuilder.Entity<ew_tbl_configurations>()
                .Property(e => e.ew_t_timestamp)
                .IsFixedLength();

            modelBuilder.Entity<ew_tbl_cultures>()
                .Property(e => e.ew_vc_name)
                .IsUnicode(false);

            modelBuilder.Entity<ew_tbl_cultures>()
                .Property(e => e.ew_vc_description)
                .IsUnicode(false);

            modelBuilder.Entity<ew_tbl_cultures>()
                .Property(e => e.ew_t_timestamp)
                .IsFixedLength();

            modelBuilder.Entity<ew_tbl_easyweb>()
                .Property(e => e.ew_vc_name)
                .IsUnicode(false);

            modelBuilder.Entity<ew_tbl_easyweb>()
                .Property(e => e.ew_vc_version)
                .IsUnicode(false);

            modelBuilder.Entity<ew_tbl_easyweb>()
                .Property(e => e.ew_t_timestamp)
                .IsFixedLength();

            modelBuilder.Entity<ew_tbl_entities>()
                .Property(e => e.ew_vc_internal_name)
                .IsUnicode(false);

            modelBuilder.Entity<ew_tbl_entities>()
                .Property(e => e.ew_t_timestamp)
                .IsFixedLength();

            modelBuilder.Entity<ew_tbl_entities>()
                .HasMany(e => e.ew_tbl_fields)
                .WithRequired(e => e.ew_tbl_entities)
                .WillCascadeOnDelete(false);

            modelBuilder.Entity<ew_tbl_fields>()
                .Property(e => e.ew_t_timestamp)
                .IsFixedLength();

            modelBuilder.Entity<ew_tbl_selection_items>()
                .Property(e => e.ew_vc_key)
                .IsUnicode(false);

            modelBuilder.Entity<ew_tbl_selection_items>()
                .Property(e => e.ew_t_timestamp)
                .IsFixedLength();

            modelBuilder.Entity<ew_tbl_selections>()
                .Property(e => e.ew_vc_internal_name)
                .IsUnicode(false);

            modelBuilder.Entity<ew_tbl_selections>()
                .Property(e => e.ew_t_timestamp)
                .IsFixedLength();

            modelBuilder.Entity<ew_tbl_selections>()
                .HasMany(e => e.ew_tbl_selection_items)
                .WithRequired(e => e.ew_tbl_selections)
                .WillCascadeOnDelete(false);
        }
    }
}
